package com.example;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TabHost;

public class Start extends TabActivity {
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.start);

		TabHost tabHost = getTabHost(); // The activity TabHost
		TabHost.TabSpec spec; // Resusable TabSpec for each tab
		Intent intent; // Reusable Intent for each tab

		// Create an Intent to launch an Activity for the tab (to be reused)
		intent = new Intent().setClass(this, MyTwitter.class);

		// Initialize a TabSpec for each tab and add it to the TabHost
		spec = tabHost.newTabSpec("update").setIndicator("Update", null)
				.setContent(intent);
		tabHost.addTab(spec);

		// Do the same for the other tabs
		intent = new Intent().setClass(this, Timeline.class);
		spec = tabHost.newTabSpec("timeline").setIndicator("Timeline", null)
				.setContent(intent);
		tabHost.addTab(spec);

		// Do the same for the other tabs
		intent = new Intent().setClass(this, ListTimeline.class);
		spec = tabHost.newTabSpec("lists").setIndicator("Lists", null)
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, Prefs.class);
		spec = tabHost.newTabSpec("prefs").setIndicator("Prefs", null)
				.setContent(intent);
		tabHost.addTab(spec);

		int childCount = tabHost.getTabWidget().getChildCount();
		for (int i = 0; childCount > i; i++)
			tabHost.getTabWidget().getChildAt(i).setLayoutParams(
					new LinearLayout.LayoutParams(85, 37));
		tabHost.setCurrentTabByTag("update");
	}

}
